package com.bootdo.order.dao;

import com.bootdo.order.domain.OrderPayDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Desc
 * @date 2019/12/16
 *
 */
@Mapper
public interface OrderPayDao {

    OrderPayDO get(Long id);

    OrderPayDO getByOrderId(String id);

    List<OrderPayDO> list(Map<String,Object> map);

    List<OrderPayDO> mList(Map<String,Object> map);

    int mConut(Map<String,Object> map);

    List<OrderPayDO> pList(Map<String,Object> map);

    int pConut(Map<String,Object> map);

    int save(OrderPayDO order);

    int update(OrderPayDO order);

    int remove(Long id);

    List<OrderPayDO> queryUserOrderPayList(@Param("orderPay") OrderPayDO order);

    Double queryUserOrderPayIncomeData (@Param("orderPay") OrderPayDO orderPay, @Param("startTime")String startTime, @Param("endTime")String endTime);

    /**
     * 获取收款户支付中的订单数据
     * @param userId
     * @return
     */
    List<OrderPayDO> getPayMentingByUserId(Long userId);

    //获取成功订单总额
    Double queryOrderMoney();

    int queryOrderMaxSort(Map<String,Object> map);


    /**
     * 优化查询SQL，统计报表
     * @param orderPay
     * @return
     */
    List<Map<String,Object>> queryUserOrderPayIncomeDataBySql(OrderPayDO orderPay);

}
